﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Wolfy.NetDisk.Core.Repository
{
    /// <summary>
    /// 删除仓储接口
    /// </summary>
    public interface IDeleteRepository<T>
    {
        /// <summary>
        /// 条件
        /// </summary>
        /// <param name="predicate">比较表达式</param>
        /// <param name="showDeleted">展示是否删除的香，默认为flase</param>
        /// <returns></returns>
        IQueryable<T> Where(Expression<Func<T, bool>> predicate, bool showDeleted = false);
        /// <summary>
        /// 获取所有
        /// </summary>
        /// <returns></returns>
        IQueryable<T> GetAll();
        /// <summary>
        /// 从回收站中还原实体
        /// </summary>
        /// <param name="entity">要恢复的实体</param>
        void Restore(T entity);
    }
}
